package conson.tech.manage.facade.controller.merchant;

import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import conson.tech.core.constant.SecurityConstants;
import conson.tech.core.response.Response;
import conson.tech.manage.merchant.entity.from.MerchantAuditInfoFrom;
import conson.tech.manage.merchant.entity.from.MerchantBaseIdFrom;
import conson.tech.manage.merchant.entity.from.MerchantQueryFrom;
import conson.tech.manage.merchant.entity.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;

/**
 * ClassName: MerchantManageController
 * Description:
 * Author: HXL
 * Date: 2020/7/3 3:53 下午
 * Version: 1.0
 */
@Slf4j
@RestController
@Api(value = "商户管理控制器",tags = "商户管理控制器")
@RequestMapping((SecurityConstants.MANAGERAPI + "/merchant"))
public class MerchantManageController {
    @ApiOperation(value = "商户审核信息查询")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantQueryFrom")
    @PostMapping("/manage/queryAudit")
    public Response<Page<MerchantAuditInfoVo>> queryMerchantAudit(HttpServletRequest request,@Valid @RequestBody  MerchantQueryFrom from){
        log.info("MerchantManageController【商户审核信息查询】--> inParam:【{}】", JSONUtil.toJsonStr(from));

        return Response.success();
    }

    @ApiOperation(value = "商户审核历史信息查询")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantBaseIdFrom")
    @PostMapping("/manage/auditHistory")
    public Response<List<MerchantAuditRecordVo>> queryMerchantInfo(HttpServletRequest request,@Valid @RequestBody  MerchantBaseIdFrom from){
        log.info("MerchantManageController【商户审核历史信息查询】--> inParam:【{}】", JSONUtil.toJsonStr(from));
        return Response.success();
    }
    @ApiOperation(value = "待审核商户基础信息详情")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantBaseIdFrom")
    @PostMapping("/manage/auditDetails")
    public Response<MerchantBaseInfoVo> queryMerchantAuditDetailsInfo(HttpServletRequest request,@Valid @RequestBody  MerchantBaseIdFrom from){
        log.info("MerchantManageController【待审核商户基础信息详情】--> inParam:【{}】", JSONUtil.toJsonStr(from));
        return Response.success();
    }
    @ApiOperation(value = "审核商户信息")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantAuditInfoFrom")
    @PostMapping("/manage/audit")
    public Response auditMerchantInfo(HttpServletRequest request,@Valid @RequestBody  MerchantAuditInfoFrom from){
        log.info("MerchantManageController【审核商户信息】--> inParam:【{}】", JSONUtil.toJsonStr(from));
        return Response.success();
    }

    @ApiOperation(value = "商户管理-商户信息查询")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantQueryFrom")
    @PostMapping("/manage/queryInfo")
    public Response<Page<MerchantBaseSettleVo>> queryMerchantInfo(HttpServletRequest request,@Valid @RequestBody MerchantQueryFrom from){
        log.info("MerchantManageController【商户管理-商户信息查询】--> inParam:【{}】", JSONUtil.toJsonStr(from));

        return Response.success();
    }
    @ApiOperation(value = "商户管理-基础信息详情")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantBaseIdFrom")
    @PostMapping("/manage/details")
    public Response<MerchantBaseInfoVo> queryMerchantDetailsInfo(HttpServletRequest request,@Valid @RequestBody  MerchantBaseIdFrom from){
        log.info("MerchantSceneApplyController【商户管理-基础信息详情】--> inParam:【{}】", JSONUtil.toJsonStr(from));
        return Response.success();
    }

    @ApiOperation(value = "商户管理-结算信息详情")
    @ApiImplicitParam(name = "from", value = "通用请求", required = true, dataType = "MerchantBaseIdFrom")
    @PostMapping("/manage/settleInfo")
    public Response<MerchantSettlementInfoVo> queryMerchantSettleInfo(HttpServletRequest request,@Valid @RequestBody  MerchantBaseIdFrom from){
        log.info("MerchantManageController【商户管理-结算信息详情】--> inParam:【{}】", JSONUtil.toJsonStr(from));
        return Response.success();
    }
}
